#ifndef QTBOARDCATALOGUSVIEWER_H_
#define QTBOARDCATALOGUSVIEWER_H_

#include <QVector>
#include <QTimeLine>
#include <QGraphicsView>
#include <QGraphicsItemAnimation>

#include "BoardCatalogusViewer.h"
#include "QtMapPreviewItem.h"

#define NUM_ITEMS_VISIBLE 4
#define ANIMATION_SPEED 1200
#define TRANS_LENGTH 500.0

class QtBoardCatalogusViewer : public QGraphicsView, public BoardCatalogusViewer
{
    Q_OBJECT
    
public:
	QtBoardCatalogusViewer(QWidget *parent = 0);
	virtual ~QtBoardCatalogusViewer();

protected:
	void populateScene();

protected slots:
	void showNextEvent();
	void showPreviousEvent();
	
	bool slideCatalogusRight();
	bool slideCatalogusLeft();

	void timerEvent(QTimerEvent *event);
	
//    void keyPressEvent(QKeyEvent *event);
//    void wheelEvent(QWheelEvent *event);
//    void drawBackground(QPainter *painter, const QRectF &rect);
//    void scaleView(qreal scaleFactor);
	
private:
	void createAnimations(int number);

	QGraphicsScene * scene;
	QVector <QGraphicsItem *> previewImages;
	
	QVector <QGraphicsItemAnimation *> animationsToLeft;
	QVector <QGraphicsItemAnimation *> animationsToRight;
	QTimeLine rightTimer;
	QTimeLine leftTimer;
	
	int paddingSize;
	int position;
};

#endif /*QTBOARDCATALOGUSVIEWER_H_*/
